import log from "./logger";
import {readFileSync} from "fs";


class Config {
    public deviceName: string
    public platformId: number
    public platformName: string
    public url: string
    public host: string
    public startIndex: number
    public queryTotal: number

    async init() {
        const {readFileSync} = require('fs');
        const data = readFileSync('./config.json');
        const config = JSON.parse(data);
        log.info(config)
        this.platformId = config.platformId
        this.platformName = config.platformName
        this.url = config.url
        this.host = config.host
        this.deviceName = config.deviceName
        this.startIndex = config.startIndex
        this.queryTotal = config.queryTotal
    }
}

const config = new Config();

export default config;